package com.starleague.hexagonal.flat;

import com.starleague.hexagonal.IHexDirection;

public enum FlatHexDirection
        implements IHexDirection
{
    NORTH, // (0.0),
    NORTHEAST, // (Math.PI / 3.0),
    SOUTHEAST, // (2.0 * Math.PI / 3.0),
    SOUTH, // (3.0 * Math.PI / 3.0),
    SOUTHWEST, // (4.0 * Math.PI / 3.0),
    NORTHWEST;// (5.0 * Math.PI / 3.0);

    private FlatHexDirection opposite = null;
    private FlatHexDirection left = null;
    private FlatHexDirection right = null;

    // public final double angleInRadians;

    @Override
    public final FlatHexDirection getOpposite()
    {
        return this.opposite;
    }

    @Override
    public final FlatHexDirection getLeft()
    {
        return this.left;
    }

    @Override
    public final FlatHexDirection getRight()
    {
        return this.right;
    }

    // private FlatHexDirection(final double angleInRadians)
    // {
    // this.angleInRadians = angleInRadians;
    // }

    static
    {
        NORTH.opposite = SOUTH;
        NORTH.left = NORTHWEST;
        NORTH.right = NORTHEAST;

        NORTHEAST.opposite = SOUTHWEST;
        NORTHEAST.left = NORTH;
        NORTHEAST.right = SOUTHEAST;

        SOUTHEAST.opposite = NORTHWEST;
        SOUTHEAST.left = NORTHEAST;
        SOUTHEAST.right = SOUTH;

        SOUTH.opposite = NORTH;
        SOUTH.left = SOUTHEAST;
        SOUTH.right = SOUTHWEST;

        SOUTHWEST.opposite = NORTHEAST;
        SOUTHWEST.left = SOUTH;
        SOUTHWEST.right = NORTHWEST;

        NORTHWEST.opposite = SOUTHEAST;
        NORTHWEST.left = SOUTHWEST;
        NORTHWEST.right = NORTH;
    }
}
